﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
//using Microsoft.Office.Interop.Excel;
using System.Data.OleDb;
using System.Data;
using System.Windows.Forms; 

namespace Pasteles.Controler
{
    class LoginCashier
    {
 Boolean Connection(string sFilename)
        {
            bool temp = false;
            try
            {
                string connectionString = String.Format(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Extended Properties=""Excel 8.0;HDR=YES;IMEX=1;""",
                sFilename);
                string query = String.Format("select [MaNhanVien] from [{0}$]", "Sheet1");
                OleDbDataAdapter dataAdapter = new OleDbDataAdapter(query, connectionString);
                DataSet dataSet = new DataSet();
                dataAdapter.Fill(dataSet);
                temp = true;
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
            }
            return temp;
        }
    }
}
